<template>
  <div class="datail">
    <h4>{{this.goodsdesc.title}}}</h4>
    <hr />
    <div v-html="this.goodsdesc.content"></div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: this.$route.params.id,
      goodsdesc: {}
    }
  },
  created() {
    this.getGoodsdesc()
  },
  methods: {
    async getGoodsdesc() {
      const { data: res } = await this.$http.get(
        `/api/goods/getdesc/${this.id}`
      )
      if (res.status !== 0) {
        return this.$toast.fail('获取图文数据失败')
      }
      this.goodsdesc = res.message[0]
    }
  }
}
</script>

<style lang="less" scoped>
h4 {
  font-size: 16px;
  color: #226aff;
  text-align: center;
  margin: 15px 0;
}
</style>
